"use strict";
cc._RF.push(module, '0f6b1+wBHBLc7TWQn2v9nl1', 'itempanel');
// script/itempanel.js

'use strict';

cc.Class({
	extends: cc.Component,

	properties: {
		note: cc.Label,
		itemSprite: cc.Sprite,
		headAtlas: cc.SpriteAtlas,
		_item: ''
	},

	onLoad: function onLoad() {
		var _this = this;

		cc.director.once('itempanel', function (e) {
			cc.log('it:e.detail=' + e.detail);
			_this._item = e.detail;
			if (e.detail == 'xiangshui') {
				_this.itemSprite.spriteFrame = _this.headAtlas.getSpriteFrame('xiangshui');;
			} else if (_this._item == 'xiunv') {
				_this.itemSprite.spriteFrame = _this.headAtlas.getSpriteFrame('head8');;
			}
		}, this);
	},
	OKbtn: function OKbtn() {
		if (this._item == 'xiangshui') {
			cc.director.emit('getitem', 'xiangshui');
		} else if (this._item == 'xiunv') {
			cc.director.emit('getitem', 'xiunv');
		}
		this.node.active = false;
	}
}

// update (dt) {},
);

cc._RF.pop();